<script type="text/javascript">
	jQuery(document).ready(function() {
		jQuery("#breadCrumb0").jBreadCrumb();
	});

	function companydel(com_id, com_number) {
		if (confirm("Are you sure to delete company number " + com_number + " ? ")) {
			window.location='<?=site_url("company/companydel")?>' + "/" + com_id;
		}
	}
</script>

<div id="breadCrumb0" class="breadCrumb module">
<ul>
	<li><a href="<?=site_url("main/home")?>">Home</a></li>
	<li>Companies List</li>
</ul>
</div>
<br/>
<h2>Companies list</h2>
<table class="table_list" cellspacing="0" cellpadding="0" width="100%">
<tr>
	<th>Number</th>
	<th>Name</th>
	<th>Description</th>
	<th>Code</th>
	<th>Phone</th>
	<th>Delete</th>
</tr>
<?php
$row_nb = 0; 
foreach($company_list->result_array() as $row) :
	$row_nb++;
?>
<tr <?=(($row_nb % 2)?"":"class=\"even_row\"")?>>
	<td align="center"><a href="<?=site_url("company/edit/".$row["com_id"])?>"><?=htmlspecialchars($row["com_number"])?></a></td>
	<td><?=htmlspecialchars($row["com_name"])?></td>
	<td><?=htmlspecialchars($row["com_desc"])?></td>
	<td><?=htmlspecialchars($row["com_code"])?></td>
	<td><?=htmlspecialchars($row["com_phone"])?></td>
	<td align="center"><a href="javascript:companydel(<?=$row["com_id"]?>, '<?=htmlspecialchars($row["com_number"])?>');"><img alt="" src="<?=base_url("images/delete.png")?>"></a></td>
</tr>
<?php endforeach; ?>
</table>
<br/>
<button onclick="window.location='<?=site_url("company/creation")?>'">New company</button>